package com;

import com.config.SpringConfig;
import com.service.IAccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试AOP的配置
 */
public class AOPTest {

    public static void main(String[] args) {
        //1.获取容器
        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        //2.获取对象
        IAccountService as = (IAccountService)ac.getBean(IAccountService.class);
        //3.执行方法
        as.saveAccount(1,2);
    }
}
